function editDataFn(){

    $("#loading").css({
        display:"block"
    })
    var oid=getQueryStringByNameTwo("oid")!=undefined?getQueryStringByNameTwo("oid"):"";
    var orEdt=getQueryStringByNameTwo("edit")!=undefined?getQueryStringByNameTwo("edit"):"";
    var itemOid=getQueryStringByNameTwo("itemOid")!=undefined?getQueryStringByNameTwo("itemOid"):"";
    var classtype="";
    var data="oid="+oid+"&itemoid="+itemOid;
    MaterialReverseAjax("/MaterialsApplication/tmGetMaterialsApplication",data,function(str){
        $("#loading").css({
            display:"none"
        });
        classtype=str.datalist!=undefined?str.datalist[0].roottype:"";
        submitFn(classtype);
        var datalist=str.datalist;
        if(classtype=="SemiFinishedGood"){
            var publicClass=commonObj.CPublicAttName;
            var publicText=commonObj.CEditAttName;
        }else if(classtype=="Material"){
            var publicClass=commonObj.POLPublicAttName;
            var publicText=commonObj.POLEditAttName;
        }
        if(classtype=="SemiFinishedGood"){
            dataListObj={
                "number":"",//物料编号
                "name":"",//物料名称
                "synchysis":"",//是否混版及混版尺寸
                "defaultUnit":"",//默认单位*
                "SemiFinishedGoodType":'',//半成品分类*
                "Coatingtype":"",//镀膜类型
                "partSingleGlassThickness":"",//单玻璃厚度*
                "cuttingMode":"",//切割方式*
                "processingModeAndThickness":"",//加工方式及薄化前后厚度*
                "Integration":"",//集成度（格式如：60PANEL）*
                "finishedGoodType":"",//成品型号
                "classificationATT":"",//分类属性

                "createType":"",//类型（成品/半成品）
                "source":"",//源*
                "partNumberEffectiveSite":"",//料号产地
                "finishedGoodSize":"",//产品尺寸*
                "otherorigin":"",//其他生效地及源类型（如只需在一地生效，请选“无”）
                "finishedGoodLineBody":"",//线体*
                "partDrawingNumber":"",//图纸编号/工艺文件编号（申请T1时必填，如：TM033HS01)）
                "partInspectionStandard":"",//检验标准:
                "partSupplier":"",//供应商：*
                "partEnvProtectionCategory":"",//环保类别:*
                "partApplicationReason":"",//申请原因
                "partNote":""//备注说明：
            };
        }else if(classtype=="Material"){
            dataListObj={
                "number":"",//物料编号
                "name":"",//物料名称
                "createType":"",//类型:
                "defaultUnit":"",//默认单位
                "partCName":"",//物料中文名称
                "partDrawingNumber":'',//材料型号/图纸编号:
                "partMainSpecification":"",//主要规格（长×宽×厚mm）
                "absorptionShaftAngle":"",//吸收轴角度(与长边逆时针方向夹角，注：长边为靠近source IC侧的边)：
                "polarizerType":"",//偏光片类型
                "surfaceTreatment":"",//表面处理方式：
                "partRecognize":"",//是否需要零件承认（POL、背光、铁框、TP、PCB（A）、FPC（A）需要零件承认）
                /*"MtlNumofPOLBtn":"",//对应下POL料号(若已有料号，务必填写正确，涉及关联mark):
                "MtlNumofPOLTop":"",//对应上POL料号(若已有料号，务必填写正确，涉及关联mark):*/
                "isBothNewPolarizer":"",//上下偏光片是否均为新增(务必确认上下偏一同申请还是仅单侧申请):
                "partDrawingNumber1":"",//上/下偏光片料号（格式例如：上偏：1040008530，下偏：1040008540）:
                "POLResolution":"",//分辨率（长×宽）:
                "DisplayMode":"",//显示模式:
                /*  "MtlNumofPOLTop1":"",//对应上POL料号:"
                  "MtlNumofPOLBtn1":"",//   对应下POL料号:*/
                "source":"",//源
                "partEnvProtectionCategory":"",//环保类别
                "finishedGoodType":"",//产品型号
                "partNumberEffectiveSite":"",//料号产地
                "partInspectionStandard":"",//检验标准:
                "partSupplier":"",//供应商：
                "materialClassification":"",//物料分级
                "partRFQNumber":"",//RFQ编号（深圳用）
                "specialMonitor":"",//是否专显
                "partApplicationReason":"",//申请人及申请原因:
                "partNote":"",//备注说明：
                "partSize":""//尺寸(模组尺寸，例如：5.13、4.30等)
            };
        }
        //  {"datalist":[{"partRFQNumber":"12312","productClassDesc":"AUT-无源车载应用；AUTA-车载前装应用；AUTB-高端要求车载后装应用；AUTC-一般要求车载后装应用；INDF-无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDT-天马中高端工业；INDS-天马普通工业；AUTTP-CTP类无源车载应用；AUTATP-CTP类车载前装应用；AUTBTP-CTP类高端要求车载后装应用；AUTCTP-CTP类一般要求车载后装应用；INDFTP-CTP类无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDTTP-CTP类天马中高端工业；INDSTP-CTP类天马普通工业；CONTP-消费类应用电容触摸屏；CON-消费类产品","classificationATT":"","partCName":"虚拟偏光片组件","surfaceTreatment":"4","partEName":"Dummy Polarizer","name":"0000000424","specialMonitor":"否","defaultUnit":"EAE","whetherPartRecognize":" ","partEnvProtectionCategory":"Q/S0002+BF","absorptionShaftAngle":"3","partInspectionStandard":"特殊标准-Amazon","partCostUnit":"人民币","createType":"原材料","partIncomingInspection":"直接接收","polarizerType":"NV","roottype":"Material","number":"0000011837","partSupplier":"1231","materialClassification":"INDT","partNote":"12312","partDrawingNumber":"8","partApplicationReason":"12312","partSize":"1231","finishedGoodType":"W123","source":"make","DisplayMode":"9","partMainSpecification":"2","isSecondSupplier":"否","partNumberEffectiveSite":"F10（武汉天马）","partRecognize":"否"},{"partRFQNumber":"12312","productClassDesc":"AUT-无源车载应用；AUTA-车载前装应用；AUTB-高端要求车载后装应用；AUTC-一般要求车载后装应用；INDF-无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDT-天马中高端工业；INDS-天马普通工业；AUTTP-CTP类无源车载应用；AUTATP-CTP类车载前装应用；AUTBTP-CTP类高端要求车载后装应用；AUTCTP-CTP类一般要求车载后装应用；INDFTP-CTP类无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDTTP-CTP类天马中高端工业；INDSTP-CTP类天马普通工业；CONTP-消费类应用电容触摸屏；CON-消费类产品","classificationATT":"","isBothNewPolarizer":"7","partCName":"下偏光片","partEName":"Polarizer","surfaceTreatment":"4","name":"0000000423","specialMonitor":"否","defaultUnit":"EAE","whetherPartRecognize":" ","partEnvProtectionCategory":"Q/S0002+BF","absorptionShaftAngle":"3","partInspectionStandard":"特殊标准-Amazon","partCostUnit":"人民币","MtlNumofPOLTop":"6","createType":"原材料","partIncomingInspection":"IQC","polarizerType":"NV","roottype":"Material","number":"0000011836","partSupplier":"1231","materialClassification":"INDT","partNote":"12312","partDrawingNumber":"1","partApplicationReason":"12312","partSize":"1231","finishedGoodType":"W123","source":"make","partMainSpecification":"2","isSecondSupplier":"否","partNumberEffectiveSite":"F10（武汉天马）","partRecognize":"是"},{"partRFQNumber":"12312","productClassDesc":"AUT-无源车载应用；AUTA-车载前装应用；AUTB-高端要求车载后装应用；AUTC-一般要求车载后装应用；INDF-无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDT-天马中高端工业；INDS-天马普通工业；AUTTP-CTP类无源车载应用；AUTATP-CTP类车载前装应用；AUTBTP-CTP类高端要求车载后装应用；AUTCTP-CTP类一般要求车载后装应用；INDFTP-CTP类无源工业应用、NLT中高端工业应用，天马特种显示、NLT普通工业；INDTTP-CTP类天马中高端工业；INDSTP-CTP类天马普通工业；CONTP-消费类应用电容触摸屏；CON-消费类产品","classificationATT":"","isBothNewPolarizer":"7","partCName":"上偏光片","partEName":"Polarizer","surfaceTreatment":"4","name":"0000000422","specialMonitor":"否","defaultUnit":"EAE","whetherPartRecognize":" ","partEnvProtectionCategory":"Q/S0002+BF","absorptionShaftAngle":"3","partInspectionStandard":"特殊标准-Amazon","MtlNumofPOLBtn":"5","partCostUnit":"人民币","createType":"原材料","partIncomingInspection":"IQC","polarizerType":"NV","roottype":"Material","number":"0000011835","partSupplier":"1231","materialClassification":"INDT","partNote":"12312","partApplicationReason":"12312","partSize":"1231","finishedGoodType":"W123","source":"make","partMainSpecification":"2","isSecondSupplier":"否","partNumberEffectiveSite":"F10（武汉天马）","partRecognize":"是"}]}
        var newPubArr=[];
        for(var j=0;j<publicText.length;j++){
            newPubArr.push(publicText[j])
        }

        newPubArr.push.apply(newPubArr,publicClass);
        var Title="<thead><tr><td title='物料编号'><span>物料编号</span></td><td title='名称'><span>名称</span></td>";
        for(var i=0;i<newPubArr.length;i++){
            if(classtype=="SemiFinishedGood"&&i<8){
                //if(i<8){
                    Title+="<td title='"+newPubArr[i]+"'><span><i style='color:red'>*</i>"+newPubArr[i]+"</span></td>";
                //}

            }else if(classtype=="Material"&&(i==1||i==13)){
                Title+="<td title='"+newPubArr[i]+"'><span><i style='color:red'>*</i>"+newPubArr[i]+"</span></td>";
            }else{
                Title+="<td title='"+newPubArr[i]+"'><span>"+newPubArr[i]+"</span></td>";
            }
            //Title+="<td title='"+newPubArr[i]+"'><span>"+newPubArr[i]+"</span></td>";
        }
        Title+="</tr></thead>";
        $(".tabRight").append(Title);
        var tableTd="<tbody>";
        var leftTypeList="<tbody>";
        if(classtype=="SemiFinishedGood"){
            //leftTypeList+="<tr><td><input type='checkbox'></td><td>"+datalist[n]["SemiFinishedGoodType"]+"</td></tr>";
            datalist=datalist.sort(compareUp(datalist,"roottype"))
        }else if(classtype=="Material"){
           // leftTypeList+="<tr><td><input type='checkbox'></td><td>"+datalist[n]["createType"]+"</td></tr>";
            datalist=datalist.sort(compareUp(datalist,"createType"))
        }
        for(var n=0;n<datalist.length;n++){
            if(classtype=="SemiFinishedGood"){
                leftTypeList+="<tr><td><input type='checkbox'></td><td>"+datalist[n]["SemiFinishedGoodType"]+"</td></tr>";
            }else if(classtype=="Material"){
                leftTypeList+="<tr><td><input type='checkbox'></td><td>"+datalist[n]["createType"]+"</td></tr>";
            }
            for(var v in dataListObj){

                    var data="";
                    if(v=="source"){
                        switch (datalist[n][v]){
                            case "make":
                                datalist[n][v]="制造"
                                break;
                            case "buy":
                                datalist[n][v]="购买"
                                break;
                            case "SUBCONTRACTOR":
                                datalist[n][v]="外加工"
                                break;
                            case "PHANTOM":
                                datalist[n][v]="虚拟件"
                                break;
                        }
                    }
                datalist[n][v]=datalist[n][v]!=undefined?datalist[n][v]:"";
                    if(v=="defaultUnit"){//单位
                        var lsit=commonObj.CUnit;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="Coatingtype"){//镀膜类型
                        var lsit=commonObj.Coatingtype;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="partSingleGlassThickness"){//单玻璃厚度
                        var lsit=commonObj.partSingleGlassThickness;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="cuttingMode"){//切割方式
                        var lsit=commonObj.CuttingMode;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="processingModeAndThickness"){//加工方式及薄化前后厚度
                        var lsit=commonObj.ThinningThicknes;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="source"&&classtype=="Material"){//原材料 源
                        var lsit=commonObj.POLSource;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="polarizerType"&&classtype=="Material"&&datalist[n]["partCName"]!="虚拟偏光片组件"){//偏光片类型
                        var lsit=commonObj.POLClassType;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="partRecognize"&&classtype=="Material"){//是否需要零件承认
                        var lsit=commonObj.POLpartRecognize;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="isBothNewPolarizer"&&classtype=="Material"&&datalist[n]["partCName"]!="虚拟偏光片组件"){//上下偏光片是否均为新增
                        var lsit=commonObj.POLpartRecognize;
                        tableTd+='<td><form class="layui-form" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select lay-ignore style="display:block;" class="select'+n+v+'" name="" lay-verify=""> <option value="'+datalist[n][v]+'">'+datalist[n][v]+'</option> </select> </div> </div></form></td>';
                        renderForm(lsit,n+v);
                    }else if(v=="isBothNewPolarizer"&&classtype=="Material"&&datalist[n]["partCName"]=="虚拟偏光片组件"){//上下偏光片是否均为新增
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else if(v=="polarizerType"&&classtype=="Material"&&datalist[n]["partCName"]=="虚拟偏光片组件"){//偏光片类型
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else if(v=="surfaceTreatment"&&classtype=="Material"&&datalist[n]["partCName"]=="虚拟偏光片组件"){//表面处理方式
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else if(v=="absorptionShaftAngle"&&classtype=="Material"&&datalist[n]["partCName"]=="虚拟偏光片组件"){//吸收轴角度
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else if(v=="POLResolution"&&classtype=="Material"&&datalist[n]["partCName"]!="虚拟偏光片组件"){//分辨率
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else if(v=="DisplayMode"&&classtype=="Material"&&datalist[n]["partCName"]!="虚拟偏光片组件"){//显示模式
                        tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ></td>"
                    }else{
                        if(v=="number"||v=="name"){
                            var data=datalist[n][v]!=undefined?datalist[n][v]:'';
                            tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' >"+data+"</td>"
                        }else if(v=="createType"){
                            var data=datalist[n][v]!=undefined?datalist[n][v]:'';
                            tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' >"+data+"</td>"
                        }else if(v=="SemiFinishedGoodType"||v=="partCName"||v=="createType"||(v=="partDrawingNumber"&&classtype=="Material"&&datalist[n]["partCName"]=="虚拟偏光片组件")){
                            var data=datalist[n][v]!=undefined?datalist[n][v]:'';
                            tableTd+="<td style='background:#eee; opacity:0.6;filter:Alpha(opacity=60) ' ><input readonly='readonly' type='text' value='"+data+"'/></td>"
                        }else{//partDrawingNumber
                            var data='';
                            if(v=="partNumberEffectiveSite"){
                                for(var q=0;q<commonObj.pelArea.length;q++){
                                    for(var f in commonObj.pelArea[q]){
                                        if(datalist[n][v]==commonObj.pelArea[q][f]){
                                            data=commonObj.pelArea[q][f];
                                        }
                                    }

                                }
                            }else{
                                data=datalist[n][v]!=undefined?datalist[n][v]:'';
                            }
                            tableTd+="<td title='"+data+"'><input type='text' value='"+data+"'/></td>"
                        }

                    }
            }
            tableTd+="</tr>";
        }
        tableTd+="</tbody>";
        leftTypeList+="</tbody>";
        $(".tabLeft").append(leftTypeList);
        $(".tabRight").append(tableTd);
        var otdLen=$(".tabRight tbody tr").eq(1).find("td").length;
        var LocalhostArrLen=0;
        if(classtype=="SemiFinishedGood"){
            LocalhostArrLen=commonObj.CEditAttName.length+2;
        }else if(classtype=="Material"){
            LocalhostArrLen=commonObj.POLEditAttName.length+2;
        }
        var localDatas=[];
        for(var d=0;d<otdLen;d++){
            if(d>(LocalhostArrLen-1)){
                var val=$(".tabRight tbody tr").eq(1).find("td").eq(d).find("input").val();
                localDatas.push(val);
                if(classtype=="SemiFinishedGood"){
                    //localStorage.setItem("commonClassTypeC",localDatas);
                }else if(classtype=="Material"){
                    var textArea="";
                    for(var s=0;s<localDatas.length;s++){
                        if(s!=(localDatas.length-1)){
                            textArea+=localDatas[s]+"&;";
                        }else{{
                            textArea+=localDatas[s];
                        }}

                    }
                   // localStorage.setItem("commonClassTypePOL",textArea);
                    // leftTypeList+="<tr><td><input type='checkbox'></td><td>"+datalist[n]["partCName"]+"</td></tr>";
                }
            }
        }
        for(var k=0;k<$(".tabRight tbody tr").length;k++){
            for(var p=0;p<otdLen;p++){
                if(p>(LocalhostArrLen-1)){
                    var val=$(".tabRight tbody tr").eq(k).find("td").eq(p).find("input").val();
                 //   localDatas.push(val);
                    $(".tabRight tbody tr").eq(k).find("td").eq(p).find("input").remove();
                    $(".tabRight tbody tr").eq(k).find("td").eq(p).text(val);
                    $(".tabRight tbody tr").eq(k).find("td").eq(p).attr("class","publicAttributes");

                }
            }
        }


        //console.log(localData);
        var height=$(".tabRight thead").height();
        $(".tabLeft thead tr").css("height",height+"px");
        var otdHeight=$(".tabRight tbody tr")/*.height()*/;
        $(".tabRight").css({
            "margin-left":$(".tabLeft thead tr").eq(0).width()
        })
        for(var w=0;w<otdHeight.length;w++){
            var offHeight= $(".tabRight tbody tr")[w].clientHeight;
            $(".tabLeft tbody tr").eq(w).css({
                "offsetHeight":otdHeight+"px"
            });
        }

    })
   function submitFn(classtype){
       if(classtype=="SemiFinishedGood"){
           $(".submitMes").click(function(){
               var trLen=$(".tabRight tbody tr");
               var tdLen=$(".tabRight tbody tr:first-child td");
               var dataListObj={
                   "number":"",//物料编号
                   "name":"",//物料名称
                   "synchysis":"",//是否混版及混版尺寸
                   "defaultUnit":"",//默认单位
                   "SemiFinishedGoodType":'',//半成品分类
                   "Coatingtype":"",//镀膜类型
                   "partSingleGlassThickness":"",//单玻璃厚度
                   "cuttingMode":"",//切割方式
                   "processingModeAndThickness":"",//加工方式及薄化前后厚度
                   "Integration":"",//集成度（格式如：60PANEL）
                   "finishedGoodType":"",//成品型号
                   "classificationATT":"",//分类属性
                   "createType":"",//类型（成品/半成品）
                   "source":"",//源
                   "partNumberEffectiveSite":"",//料号产地
                   "finishedGoodSize":"",//产品尺寸
                   "otherorigin":"",//其他生效地及源类型（如只需在一地生效，请选“无”）
                   "finishedGoodLineBody":"",//线体
                   "partDrawingNumber":"",//图纸编号/工艺文件编号（申请T1时必填，如：TM033HS01)）
                   "partInspectionStandard":"",//检验标准:
                   "partSupplier":"",//供应商：
                   "partEnvProtectionCategory":"",//环保类别:
                   "partApplicationReason":"",//申请原因
                   "partNote":""//备注说明：
               };
               var datalist=[];
               var noneArr=[];
               for(var i=0;i<trLen.length;i++){
                   var dataArr=[];
                   for(var m=0;m<tdLen.length;m++){
                       var input = $(trLen).eq(i).find("td").eq(m).find("input").val();
                       if($(trLen).eq(i).find("td").eq(m).find("input").length==0&&$(trLen).eq(i).find("td").eq(m).find("select").length==0){
                           input=$(trLen).eq(i).find("td").eq(m).text();
                       }else{
                           if(input!=undefined){
                               if(input=="<自动生成>"){
                                   input="";
                               }
                               if(m!=0&&m!=1&&m!=10&&m!=11&&m!=12&&(input=="")&&m<(commonObj.CEditAttName.length+2)){
                                   $(trLen).eq(i).find("td").eq(m).css({
                                       "background":"rgb(255,255,170)",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"

                                   });
                                   noneArr.push(m);
                               }else if(m!=0&&m!=1&&m!=10&&m!=11&&m!=12&&(input!="")&&m<(commonObj.CEditAttName.length+2)){
                                   $(trLen).eq(i).find("td").eq(m).css({
                                       "background":"#fff",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"
                                   });
                               }
                           }else{
                               input=$(trLen).eq(i).find("td").eq(m).find("select option:selected").text();
                               if(m!=0&&m!=1&&m!=10&&m!=11&&m!=12&&(input=="")&&m<(commonObj.CEditAttName.length+2)){
                                   $(trLen).eq(i).find("td").eq(m).css({
                                       "background":"rgb(255,255,170)",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"

                                   });
                                   $(trLen).eq(i).find("td").eq(m).find(".layui-form [lay-ignore] ").css({
                                       "background":"rgb(255,255,170)",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"
                                   })
                                   noneArr.push(m);
                               }else if(m!=0&&m!=1&&m!=10&&m!=11&&m!=12&&(input!="")&&m<(commonObj.CEditAttName.length+2)){
                                   $(trLen).eq(i).find("td").eq(m).css({
                                       "background":"#fff",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"

                                   });
                                   $(trLen).eq(i).find("td").eq(m).find(".layui-form [lay-ignore] ").css({
                                       "background":"#fff",
                                       "-webkit-transition": "all .5s ease-in",
                                       "-moz-transition": "all .5s ease-in",
                                       "transition": "all .5s ease-in"

                                   })
                               }
                           }
                       }

                       dataArr.push(input);
                   }

                   var dataV=[];
                   for(var v in dataListObj){
                       dataV.push(v)
                   }
                   var obj={"roottype":"SemiFinishedGood"};
                   for(var n=0;n<dataV.length;n++){
                       obj[dataV[n]]=dataArr[n];

                   }
                   obj["roottype"]="SemiFinishedGood";
                   datalist.push(obj);
               }
               if(noneArr.length>0){
                   layerFn("请将带*号的属性填写完整");
                   return;
               }
               var url="/MaterialsApplication/tmEditMaterialsApplication";
               var data={
                   datalist:datalist
               }
               $("#loading").css({
                   display:"block"
               });
               ajaxNewFn(url,data,function(str){
                   $("#loading").css({
                       display:"none"
                   });
                   if(str.numberlist!=undefined&&str.numberlist.length>0){
                       var num="";

                       for(var k=0;k<str.numberlist.length;k++){
                           if(k!=(str.numberlist.length-1)){
                               num+=str.numberlist[k]+'；'
                           }else{
                               num+=str.numberlist[k]
                           }
                       }

                       var mesg="编号为："+num+"的物料属性参数修改成功";
                       layerFn(mesg,function(){
                           window.location.href="about:blank";
                           window.opener=null;
                           window.open('','_self');
                           window.close();
                       })
                   }else{
                       var mesg="物料属性参数修改失败"
                       layerFn(mesg,function(){
                           window.location.href="about:blank";
                           window.opener=null;
                           window.open('','_self');
                           window.close();
                       })
                   }
               })

           })
       }else if(classtype=="Material"){
           $(".submitMes").click(function(){
               var trLen=$(".tabRight tbody tr");
               var tdLen=$(".tabRight tbody tr:first-child td");
               var dataListObj={
                   "number":"",//物料编号
                   "name":"",//物料名称
                   "createType":"",//类型:
                   "defaultUnit":"",//默认单位
                   "partCName":"",//物料中文名称
                   "partDrawingNumber":'',//材料型号/图纸编号:
                   "partMainSpecification":"",//主要规格（长×宽×厚mm）
                   "absorptionShaftAngle":"",//吸收轴角度(与长边逆时针方向夹角，注：长边为靠近source IC侧的边)：
                   "polarizerType":"",//偏光片类型
                   "surfaceTreatment":"",//表面处理方式：
                   "partRecognize":"",//是否需要零件承认（POL、背光、铁框、TP、PCB（A）、FPC（A）需要零件承认）
                   /* "MtlNumofPOLBtn":"",//对应下POL料号(若已有料号，务必填写正确，涉及关联mark):
                    "MtlNumofPOLTop":"",//对应上POL料号(若已有料号，务必填写正确，涉及关联mark):*/
                   "isBothNewPolarizer":"",//上下偏光片是否均为新增(务必确认上下偏一同申请还是仅单侧申请):
                   "partDrawingNumber1":"",//上/下偏光片料号（格式例如：上偏：1040008530，下偏：1040008540）:
                   "POLResolution":"",//分辨率（长×宽）:
                   "DisplayMode":"",//显示模式:
                   /*  "MtlNumofPOLTop1":"",//对应上POL料号:"
                     "MtlNumofPOLBtn1":"",//   对应下POL料号:*/
                   "source":"",//源
                   "partEnvProtectionCategory":"",//环保类别
                   "finishedGoodType":"",//产品型号
                   "partNumberEffectiveSite":"",//料号产地
                   "partInspectionStandard":"",//检验标准:
                   "partSupplier":"",//供应商：
                   "materialClassification":"",//物料分级
                   "partRFQNumber":"",//RFQ编号（深圳用）
                   "specialMonitor":"",//是否专显
                   "partApplicationReason":"",//申请人及申请原因:
                   "partNote":"",//备注说明：
                   "partSize":""//尺寸(模组尺寸，例如：5.13、4.30等)
               };

               var datalist=[];
               for(var i=0;i<trLen.length;i++){
                   var dataArr=[];
                   for(var m=0;m<tdLen.length;m++){
                       if(m>15||m==0||m==1||m==2){
                           var oTdText=$(trLen).eq(i).find("td").eq(m).text();
                           dataArr.push(oTdText)
                       }else{
                           var input = $(trLen).eq(i).find("td").eq(m).find("input").val();
                           if(input!=undefined){
                               if(input=="<自动生成>"){
                                   input="";
                               }

                           }else{
                               input=$(trLen).eq(i).find("td").eq(m).find("select option:selected").text();
                           }
                           if((i==3||i==15)&&input==""){
                               layerFn("请将带*的所有属性填写完整");
                               return;
                           }
                           dataArr.push(input);
                       }
                   }
                   var dataV=[];
                   for(var v in dataListObj){
                       dataV.push(v)
                   }
                   var obj={"roottype":"Material"};
                   for(var n=0;n<dataV.length;n++){
                       obj[dataV[n]]=dataArr[n];

                   }
                   obj["roottype"]="Material";
                   //console.log(dataV);
                   datalist.push(obj);
               }
               var url="/MaterialsApplication/tmEditMaterialsApplication";
               var data={
                   datalist:datalist
               }
               $("#loading").css({
                   display:"block"
               });
               ajaxNewFn(url,data,function(str){
                   $("#loading").css({
                       display:"none"
                   });
                   if(str.numberlist!=undefined&&str.numberlist.length>0){
                       var num="";
                       for(var k=0;k<str.numberlist.length;k++){
                           if(k!=(str.numberlist.length-1)){
                               num+=str.numberlist[k]+'；'
                           }else{
                               num+=str.numberlist[k]
                           }

                       }
                       var mesg="物料"+num+"属性参数修改成功"
                       layerFn(mesg,function(){
                           window.location.href="about:blank";
                           window.opener=null;
                           window.open('','_self');
                           window.close();
                       })
                   }else{
                       var mesg="物料属性参数修改失败"
                       layerFn(mesg)
                   }
               })

           })
       }
   }


}